﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GhostRoom.aspx.cs" Inherits="GhostGame.GhostRoom" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title></title>
</head>
<body>
    <form id="form1" runat="server" style="height: auto; width: auto">
    <div>
        <asp:Label runat="server" Text="房间名" Width="100%" Font-Size="Small" />
        <asp:TextBox runat="server" ID="TBRoomName" Width="100%"></asp:TextBox>
        <%if (this.user.ID != this.room.Holder.ID)
          {%>
            <asp:Label runat="server" Text="我的词" Width="100%" Font-Size="Small" />
        <%} %>

        <%if (this.user.ID == this.room.Holder.ID)
          {%>
            <asp:Button runat="server" ID="SetGame" Text="设置" Width="100%" 
                onclick="SetGame_Click" />
            <asp:Label runat="server" Text="人词" Width="100%" Font-Size="Small" />
        <%} %>
        
        <%if (this.user.ID == this.room.Holder.ID || (!this.user.IsGhost
              && this.room.Status == GhostGame.DataObjects.GhostRoom.RoomStatus.GhostHunting))
          {%>
            <asp:TextBox runat="server" ID="HumanWord" Width="100%"></asp:TextBox>
        <%} %>
        
        <%if (this.user.ID == this.room.Holder.ID)
          {%>
            <asp:Label runat="server" Text="鬼词" Width="100%" Font-Size="Small" />
        <%} %>

        <%if (this.user.ID == this.room.Holder.ID || (this.user.IsGhost
              && this.room.Status == GhostGame.DataObjects.GhostRoom.RoomStatus.GhostHunting))
          {%>
            <asp:TextBox runat="server" ID="GhostWord" Width="100%"></asp:TextBox>
        <%} %>
        
        <%if (this.user.ID == this.room.Holder.ID)
          {%>
            <asp:Button runat="server" ID="StartGame" Text="开始游戏" Width="100%" OnClick="StartGame_Click" />
        <%} %>

        <asp:Repeater runat="server" ID="RoomMembers" OnItemCommand="RoomMembers_ItemCommand"
            OnItemDataBound="RoomMembers_ItemDataBound">
            <ItemTemplate>
                <div style="width: auto; height: auto">
                    <asp:Label runat="server" Font-Size="Small" ViewStateMode="Enabled" />
                    <asp:CheckBox AutoPostBack="true" OnCheckedChanged="DiedCheckChanged" Text="死亡" runat="server"
                        Font-Size="Small" />
                    <%if (this.user.ID == this.room.Holder.ID)
                      {%>
                    <asp:CheckBox AutoPostBack="true" OnCheckedChanged="GhostCheckedChanged" Text="鬼"
                        runat="server" Font-Size="Small" />
                    <asp:Button CommandName="KickOut" runat="server" Text="踢出" />
                    <asp:Button CommandName="SetJudge" runat="server" Text="法官" />
                    <%} %>
                </div>
            </ItemTemplate>
        </asp:Repeater>
        <%if (this.user.ID == this.room.Holder.ID)
          {%>
            <asp:Button runat="server" ID="EndGame" Text="结束本轮" Width="100%" 
            onclick="EndGame_Click" />
        <%} %>
            <asp:Button runat="server" ID="QuitGame" Text="退出游戏" Width="100%" 
            onclick="QuitGame_Click" />
        <asp:Button runat="server" Width="100%" Text="刷新" onclick="Refresh_Click"></asp:Button>
    </div>
    </form>
</body>
</html>
